﻿using System;
using System.Linq.Expressions;
using NPoco.Linq;

namespace BestEasyCMS.Framework.Querying
{
    public static class QueryHelper
    {
        public static IQueryProvider<TSource> HasWhere<TSource>(this IQueryProvider<TSource> query, object target,
            Expression<Func<TSource, bool>> whereExpression)
        {
            if (target != null)
            {
                query.Where(whereExpression);
            }
            return query;
        }
    }
}
